//
//  MRDestinationTableViewCell.m
//  Travel_World
//
//  Created by dllo on 15/10/13.
//  Copyright © 2015年 TLS. All rights reserved.
//

#import "MRDestinationTableViewCell.h"

@implementation MRDestinationTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self createCell];
        
    }
    return self;
}

- (void)createCell
{
    self.cnname = [[UILabel alloc] init];
    self.cnname.font = [UIFont systemFontOfSize:15];
    [self addSubview:self.cnname];
    
    self.enname = [[UILabel alloc] init];
    self.enname.font = [UIFont systemFontOfSize:13];
    self.enname.textColor = [UIColor grayColor];
    [self addSubview:self.enname];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    NSDictionary *fontDic = [NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:17],NSFontAttributeName, nil];
    CGRect rect = [self.cnname.text boundingRectWithSize:CGSizeMake(0, 30) options:NSStringDrawingUsesLineFragmentOrigin attributes:fontDic context:nil];
    
    self.cnname.frame = CGRectMake(20, 10, rect.size.width, 30);
    
    self.enname.frame = CGRectMake(rect.size.width + 30, 10, 200, 30);
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
